$NOMOD51

STACK_START     EQU     0x118 //0x118          //default at 0x180-0x1c0

#include "ac309n.h"
#include "clock.h"

                NAME    ?C_STARTUP


?C_C51STARTUP   SEGMENT   CODE


														
              //  EXTRN CODE (_PLL_input)
                EXTRN CODE (?C_START)
                PUBLIC  ?C_STARTUP

                CSEG    AT      0x180
			    nop   
?C_STARTUP:     LJMP    STARTUP1

                RSEG    ?C_C51STARTUP

STARTUP1:
////////////////////////////////////////
//               	MOV     P0PD, #0
//				MOV     P0PU, #0
//				MOV     R7, #PLL_IN_AUTO
//                CALL    _PLL_input
/*
				MOV		DPCON, #0x20		//DPTR0 AUTO DEC
			
			 MOV     DPTR,#0x37FF		//9k
XDATALOOP:
                CLR     A
      			MOVX    @DPTR,A

				MOV     A,DPL
				XRL     A,#0xFF
				JNZ     XDATALOOP
				MOV     A,DPH
				XRL     A,#0xFF
				JNZ     XDATALOOP
	   */
                CLR     A
				MOV		DPCON, #0x00
                MOV     PSW,A
//////////////////////////////////////////
				MOV     SP,#low(STACK_START - 1)
				MOV     SPH,#high(STACK_START - 1)               
	   			 
//			    mov a ,#0x55 
//				push acc
//				mov a ,#0xaa
//				push acc   
                LJMP    ?C_START

                END
